class DataCollectionModel {
    constructor() {
        this.selectedTypes = new Map();
        this.dataTypes = this.getDataTypes();
        this.targetItems = this.getTargetItems();
        this.trackingReasons = this.getTrackingReasons();
    }

    addDataType(typeKey, data) {
        this.selectedTypes.set(typeKey, data);
    }

    removeDataType(typeKey) {
        this.selectedTypes.delete(typeKey);
    }

    hasDataType(typeKey) {
        return this.selectedTypes.has(typeKey);
    }

    getSelectedTypes() {
        return Array.from(this.selectedTypes.entries()).map(([typeKey, data]) => ({
            typeKey,
            ...data
        }));
    }

    getDataTypes() {
        return {
            'ContactInfo': {
                groupName: '用户信息',
                items: [
                    {
                        typeKey: 'NSPrivacyCollectedDataTypeName',
                        typeName: '姓名',
                        translationDes: '名字'
                    },
                    // ... 其他数据类型
                ]
            },
            // ... 其他分组
        };
    }

    getTargetItems() {
        return [
            {
                typeKey: 'NSPrivacyCollectedDataTypeLinked',
                explain: 'Linked to identity',
                translationDes: '与身份关联'
            },
            {
                typeKey: 'NSPrivacyCollectedDataTypeTracking',
                explain: 'Collected for tracking',
                translationDes: '收集用于跟踪'
            }
        ];
    }

    getTrackingReasons() {
        return [
            {
                typeKey: 'NSPrivacyCollectedDataTypePurposeThirdPartyAdvertising',
                explain: '3rd party ads',
                translationDes: '三方广告'
            },
            // ... 其他原因
        ];
    }
}

export default DataCollectionModel; 